import 'package:flutter/material.dart';
import 'package:word/src/word_painter.dart';

import 'entity.dart';

class Word extends StatelessWidget {
  final List<WordItem> items;

  const Word({Key key, this.items = const []}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    if (items.isEmpty) {
      return Container();
    }

    return SingleChildScrollView(
      child: Container(
        constraints: BoxConstraints(
          minHeight: 300.0,
        ),
        child: CustomPaint(
          child: Container(),
          painter: WordPainter(context, items),
        ),
      ),
    );
  }
}
